#include"MyHash.h"

void CloseText()
{
    srand((unsigned int)time(nullptr));
    CloseHsah::HachTable<int> ht;
    for(int i = 0;i<23;i++)
    {
    // std::cout << i << ":"<< ht.find(i) << std::endl;
        ht.insert(i);
    }
    ht.print();
    std::cout << ht.find(2) << std::endl;
    for(int i = 0;i<10;i++)
    {
        int j = rand()%22;
        std::cout << j << " ";
        ht.erase(j);
    }
    printf("\n");
    ht.print();
}
void HashBucketText()
{
    srand((unsigned int)time(nullptr));
    HashBucket::HashTable<int> ht;
    for(int i = 0;i<23;i++)
    {
    // std::cout << i << ":"<< ht.find(i) << std::endl;
        ht.insert(i);
    }
    ht.print();
    std::cout << ht.find(2) << std::endl;
    for(int i = 0;i<10;i++)
    {
        int j = rand()%22;
        std::cout << j << " ";
        ht.erase(j);
        std::cout << ht.find(j) << std::endl; 
    }
    printf("\n");
    ht.print();

}
int main()
{

//  CloseText();
  HashBucketText();
  return 0;
}
